<template>
  <div>
   <div class="title"><span>排行榜</span></div>
    <div v-show='show' class="wrap" v-for='(item,index) in list'>
      <div class="icon" v-if='index<3'>
        <img v-if='index==0' src="../../assets/ranking_first.png" alt="">
        <img v-if='index==1' src="../../assets/ranking_second.png" alt="">
        <img v-if='index==2' src="../../assets/ranking_third.png" alt="">
      </div>
      <div v-else class="icon">
        <span>{{index+1}}</span>
      </div>
      <div class="details">
        <div class="user">
          <span>{{item.username}}</span>
        </div>
        <div class="products">推广
          <span>{{item.userCount}}</span>人	
        </div>
        <div class="profit">
          <span>获得</span>
          <br>
          <span class="Price">{{item.profit}}</span>
        </div>
      </div>
    </div>
  
  </div>
</template>
<script>
export default {
	data(){
	    return {
	      list:[]
	    }
	 },
	 
	 computed: {
		  getUserData() {
		    return this.list=this.$store.state.ranks.ranks;
		  }
		},
		watch: {
		  getUserData(val) {
		    this.data = val;
		  }
		},
  	props: {
	    show: {
	      type: Boolean,
	      default: true
	    }
  	}
}
</script>

<style lang="less" scoped>
@import '../../less/config.less';
.title{
	padding: 0 @p30;
	font-size:@f28;
	height: 1.0933rem;
	line-height: 1.0933rem;
	color: white;
	border-bottom: 1px solid #262934;
	span{
		height: 1.0933rem;
		line-height: 1.0933rem;
		width: 1.6rem;
		display: block;
		border-bottom: 0.0533rem solid #FFFFFF;
	}
}
.wrap {
  height: 1.6rem;
  color: @fcolor;
  font-size: 0.37333rem;
  padding: 0 @p30;
  border-top: 1px solid #262934;
  display: flex;
  background: @liBg;
  justify-content: space-between;
  align-items: center;
  .icon{
    width: 0.64rem;
    height: 0.73333rem;
    text-align: center;
  }
  img {
    width: 0.64rem;
    height: 0.73333rem;
  }
  .details {
    position: relative;
    height: 1.6rem;
    width: 7.81333rem;
    margin-left: 0.74667rem;
    div {
      position: absolute;
      line-height: 1.5;
    }
    .user {
      top: 0.5rem;
      left: 0;
    }
    .products {
      top: 0.5rem;
      left: 3rem;
      span{
      	color: #ffd900;
      }
    }
    .profit {
      top: 0.3rem;
      right: 0;
    }
    .tips {
      color: @Color;
      font-size: 0.32rem;
    }
    .Price {
      color: @actColor;
      font-size: 0.32rem;
    }
  }
}
</style>
